<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>

    <script>

        // 随机验证码    abcd  a12s
        //   0-9   a-z   A-Z  

        var numArr = [0 , 1 , 2 , 3 , 4 , 5 , 6 , 7 , 8 , 9] ;

        var smallArr = ['a' , 'b' , 'c' , 'd' , 'e' , 'f'] ;

        var bigArr = ['A' , 'B' , 'C' , 'D' , 'E' , 'F'] ;

        var allArr = smallArr.concat(numArr , bigArr) ;

        console.log(allArr) ;

        // 就是从allArr 数组中随机取  n个数  作为随机验证码


        // 分析：验证码是一个字符串 

        // var res = '' ;
        // for(var i = 0 ; i < 4 ; i++) {
        //     res += allArr[rand(0 , allArr.length)] ;
        // }

        // console.log(res) ;





        
        function rand(min , max) {
            return parseInt(Math.random() * (max - min)) + min ;
        } 




    </script>
    
</body>
</html>